package com.zxt.user.api.constants;

import org.springframework.util.StringUtils;

public class RedisKeyUser {

    private static final String USER = "user:";

    /**
     * 登录用户 redis key
     *
     * @param token
     * @return
     */
    public static String getUserKey(String token) {
        if (StringUtils.isEmpty(token)) {
            return "";
        }
        StringBuilder sbBuilder = new StringBuilder(80);
        sbBuilder.append(USER);
        sbBuilder.append("token:");
        sbBuilder.append(token);
        return sbBuilder.toString();
    }
}
